package com.test;

import java.util.HashMap;
import java.util.Iterator;

public class HashMapStructure {

	public static void main(String[] args) {
		
		Country india = new Country("india", 1000);
		Country japan = new Country("japan", 10000);
		Country france = new Country("france", 2000);
		Country russia = new Country("russia", 20000);
		
		HashMap<Country, String> countryCapitalMap = new HashMap<Country, String>();
		
		countryCapitalMap.put(india, "delhi");
		countryCapitalMap.put(japan, "Tokyo");
		countryCapitalMap.put(france, "Paris");
		countryCapitalMap.put(russia, "Moscow");
		countryCapitalMap.put(null, null);
		countryCapitalMap.put(null, null);
		
		Iterator<Country> countryCapitallter = countryCapitalMap.keySet().iterator();
		while(countryCapitallter.hasNext()){
			Country countryObj = countryCapitallter.next();
			String capital = countryCapitalMap.get(countryObj);
			System.out.println(countryObj.getName() + "=====" + capital);
		}
		
		
	}
}
